/*
 * Copyright (c) 2010-2013 Ruben Chakhmakhchyan. All rights reserved.
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Eclipse Public License
 * Version 1.0 (the 'License'). You may not use this file except in
 * compliance with the License. Please obtain a copy of the License at
 * http://opensource.org/licenses/EPL-1.0 and read it before using this file.
 */

#pragma once

#include "commontypes.h"
#include "pdf_obj.h"


class PdfStream;

class PdfWriter
{
public:

    PdfWriter( PdfStream& stream );


    PdfWriter& write( byte_t value );

    PdfWriter& writeBytes( byte_t* value, uint_t size );

    PdfWriter& writeInt( int value );
    PdfWriter& writeInt( int value, int padleft );

    PdfWriter& write( const char* value );

    PdfWriter& write( byte_t* value, uint_t length );

    PdfWriter& writeLF();
    PdfWriter& writeCR();
    PdfWriter& writeCRLF() { return writeCR().writeLF(); }

    PdfWriter& writeObject( const PdfObject& value );

    uint_t getPosition();

private:

    PdfStream& m_stream;
};
